import area from '@/api/util/area';

/**
 * 省市区列表
 * */
const other = {
  state: {
    areaLoaded:false,
    area:[],
  },
  mutations: {
    SET_AREA: (state, area) => {
      state.areaLoaded = true;
      state.area = area;
    },
  },
  actions: {
    GenerateArea: ({commit}) => {
      let data = area.data;
      return new Promise(resolve => {
        commit('SET_AREA',data);
        resolve();
      });
    },
  },
  getters:{
    areaLoaded: state => state.areaLoaded,
    area: state => state.area,
  }
};

export default other;
